# -*- coding: utf-8 -*-
# @Author : HJH
# @Time : 2024/3/12 14:52
# @Use : 共享航班号匹配
import hashlib
import json
import queue
import uuid

import pandas as pd
import requests

from aliapi.request import send_pat_request

if __name__ == '__main__':
    send_pat_request("3U", "PEK", "CTU", "M", "2024-03-23", "")

    # 创建线程安全的队列
    shared_queue = queue.Queue()


    # file_path1 = input("输入需要追加的文件: ")
    # file_path2 = input("输入包含MF舱位数文件: ")
    # print("读取文件数据... ...")
    # pd_data = pd.read_excel(file_path1, sheet_name='Sheet1')
    # pd_data2 = pd.read_excel(file_path2, sheet_name='Sheet1')
    # # 将每一行转为字典，并存储在一个列表中
    # data_dict_list = pd_data.to_dict(orient='records')
    # data_dict_list2 = pd_data2.to_dict(orient='records')
    # res_data = []
    # print("开始匹配处理数据... ...")
    # for data_dict in data_dict_list:
    #     list1 = [d for d in data_dict_list2 if
    #              data_dict['MU航班号'] in d['shareFlightNo'] and
    #              data_dict['depcode'] + data_dict['arrcode'] == d['airline'] and
    #              data_dict['the_date'] == d['depDate'].strftime("%Y-%m-%d") and
    #              data_dict['MF航班号'] == d['flightNo']]
    #     if len(list1) > 0:
    #         if ('E' not in list1[0].get('cabin-T') and
    #                 'Q' not in list1[0].get('cabin-T') and
    #                 'S' not in list1[0].get('cabin-T') and
    #                 'C' not in list1[0].get('cabin-T') and
    #                 'L' not in list1[0].get('cabin-T')):
    #             data_dict['cabin'] = list1[0].get('cabin-T')
    #         elif ('E' not in list1[0].get('cabin-V') and
    #               'Q' not in list1[0].get('cabin-V') and
    #               'S' not in list1[0].get('cabin-V') and
    #               'C' not in list1[0].get('cabin-V') and
    #               'L' not in list1[0].get('cabin-V')):
    #             data_dict['cabin'] = list1[0].get('cabin-V')
    #         elif ('E' not in list1[0].get('cabin-Q') and
    #               'Q' not in list1[0].get('cabin-Q') and
    #               'S' not in list1[0].get('cabin-Q') and
    #               'C' not in list1[0].get('cabin-Q') and
    #               'L' not in list1[0].get('cabin-Q')):
    #             data_dict['cabin'] = list1[0].get('cabin-Q')
    #         else:
    #             data_dict['cabin'] = list1[0].get('cabin-N')
    #
    #     res_data.append(data_dict)
    #
    #     # 将列表转换为 DataFrame
    # df = pd.DataFrame(res_data)
    #
    # print("开始写入文件... ...")
    # # 将数据写入 Excel 文件并设置表头
    # with pd.ExcelWriter('OutDataFile2.xlsx', engine='xlsxwriter') as writer:
    #     df.to_excel(writer, index=False, )
    #
    # # 输出成功提示
    # print("Excel 文件写入成功！")
